package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library")
load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module")
load("//src/e2e-app:test_suite.bzl", "e2e_test_suite")

ng_module(
    name = "mdc-button",
    srcs = glob(
        ["**/*.ts"],
        exclude = ["**/*.spec.ts"],
    ),
    assets = [
        ":button_scss",
        ":fab_scss",
        ":icon-button_scss",
    ] + glob(["**/*.html"]),
    module_name = "@angular/material-experimental/mdc-button",
    deps = [
        "//src/cdk/platform",
        "//src/material/core",
    ],
)

sass_library(
    name = "mdc_button_scss_lib",
    srcs = glob(["**/_*.scss"]),
    deps = [
        "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
        "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
        "//src/material/core:core_scss_lib",
    ],
)

sass_binary(
    name = "button_scss",
    src = "button.scss",
    include_paths = [
        "external/npm/node_modules",
    ],
    deps = [
        "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
        "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
        "//src/material/core:all_themes",
    ],
)

sass_binary(
    name = "fab_scss",
    src = "fab.scss",
    include_paths = [
        "external/npm/node_modules",
    ],
    deps = [
        "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
        "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
        "//src/material/core:all_themes",
    ],
)

sass_binary(
    name = "icon-button_scss",
    src = "icon-button.scss",
    include_paths = [
        "external/npm/node_modules",
    ],
    deps = [
        "//src/material-experimental/mdc-helpers:mdc_helpers_scss_lib",
        "//src/material-experimental/mdc-helpers:mdc_scss_deps_lib",
        "//src/material/core:all_themes",
    ],
)

ng_e2e_test_library(
    name = "e2e_test_sources",
    srcs = glob(["**/*.e2e.spec.ts"]),
    deps = [
        "//src/cdk/testing/e2e",
    ],
)

e2e_test_suite(
    name = "e2e_tests",
    deps = [
        ":e2e_test_sources",
        "//src/cdk/testing/e2e",
    ],
)
